package huoye.shops.huoye.mine.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.codeideology.android.widget.recycler.RecyclerViewAdapter;

import butterknife.BindView;
import huoye.shops.R;
import huoye.shops.base.APIUrls;
import huoye.shops.huoye.mine.model.ContractData;
import huoye.shops.huoye.mine.model.DividendInfo;
import huoye.shops.huoye.operation.model.AddImage;


/**
 * Created by uesr on 2018/8/10.
 */

public class EnterPactAdapter extends RecyclerViewAdapter<EnterPactAdapter.ViewHolder, ContractData> {


    public EnterPactAdapter(Context context) {
        super(context, R.layout.item_enter_pact);
    }

    @Override
    protected ViewHolder initViewHolder(View view, int i) {

        return new ViewHolder(view);
    }

    @Override
    protected void bindView(ViewHolder holder,ContractData data, int i) {
        Glide.with(getContext())
                .load(APIUrls.COMMON_CONFIG.TYPE_COMMON_ALIYUN+data.getImgUrl())
                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                .placeholder(R.mipmap.ic_wait_logo)
                .error(R.mipmap.ic_error)
                .into(holder.iv);

    }




    public class ViewHolder extends RecyclerViewAdapter.ViewHolder {

        @BindView(R.id.item_item_enter_pact_iv)
        ImageView iv;





        public ViewHolder(View itemView) {
            super(itemView);
        }
    }





}
